#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

//struct Test
//{
//	int Num;
//	char* pcName;
//	short sDate;
//	char cha[2];
//	short sBa[4];
//}*p;
//
//int main()
//{
//	printf("%p\n", p + 0x1);
//	printf("%p\n", (unsigned long)p + 0x1);
//	printf("%p\n", (unsigned int*)p + 0x1);
//	return 0;
//}
//


//int main()
//{
//	char* a[] = { "work","at","alibaba" };
//	char** pa = a;
//	pa++;
//	printf("%s\n", *pa);
//	return 0;
//}

#include<stdio.h>

int  main()
{
    int count1 = 0;
    int count2 = 0;
    char a = 0;
    while ((a = getchar()) != '0')
    {
        if (a  == 'A')
        {
            count1++;
        }
        else 
        {
            count2++;
        }
    }
    if (count1 < count2)
    {
        printf("B");
    }
    else if (count1 > count2)
    {
        printf("A");
    }
    else
    {
        printf("E");
    }
    return 0;
}
